28. Classification

Nd113 C7 45 L Classification V1

INSTRUCTOR NOTE:

This video cuts off a bit early, but all the better for you to test your intuition and jump into coding a threshold of your own creation in the next notebook!

Classification Task

Let’s now complete our day and night classifier. After we extracted the average brightness value, we want to turn this feature into a predicted_label that classifies the image.
Remember, we want to generate a numerical label, and again, since we have a binary dataset, I’ll create a label that is a 1 if an image is predicted to be day and a 0 for images predicted to be night.

I can create a complete classifier by writing a function that takes in an image, extracts the brightness feature, and then checks if the average brightness is above some threshold X.

If it is, this classifier returns a 1 (day), and if it’s not, this classifier returns a 0 (night)!

Next, you'll take a look at this notebook and get a chance to tweak the threshold parameter. Then, when you're able to generate predicted labels, you can compare them to the true labels, and check the accuracy of our model!